import { h } from 'vue';
import { AdColumn } from '@/components/AdTable';
import { expandAndToString } from '@/utils/common';
import { BasicUpload } from '@/components/Upload';
import { TableImg } from '@/components/Table';
import { uploadApi } from '@/api/sys/upload';
import { List } from '@/components/Linqts';
import { isArray, isNull, isObject, isString } from '@/utils/is';
import FileUpload from '/@/components/Form/src/components/FileUpload.vue';
import { debug } from 'console';
import { readNode } from './warehousearea.api';
import { getWareHouseAreaTypeEnumSchema } from './warehousearea.enum';

const wareHouseAreaTypeEnumSchema = getWareHouseAreaTypeEnumSchema();
export const columns: AdColumn[] = [
  {
    title: '主键',
    dataIndex: 'Id',
    dataType: 'guid',
    width: 300,
    defaultHidden: true,
    filterable: false,
    sorter: true,
    formVisible: true,
    formEditable: false,
  },
  {
    title: '仓库',
    dataIndex: 'WareHouseId',
    dataType: 'guid',
    width: 150,
    defaultHidden: true,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
    editComponent: 'ApiSelect',
    editComponentProps: {
      api: readNode,
      // use name as label
      labelField: 'Name',
      // use id as value
      valueField: 'Id',
      immediate: true,
      optionFilterProp: 'label',
      showSearch: true,
    },
  },
  {
    title: '仓库名称',
    dataIndex: 'ParentName',
    dataType: 'string',
    width: 150,
    formVisible: false,
    formEditable: false,
    required: false,
    filterable: false,
    sorter: false,
  },
  {
    title: '库区名称',
    dataIndex: 'AreaName',
    dataType: 'string',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
  },
  {
    title: '库区类型',
    dataIndex: 'AreaType',
    dataType: 'enum',
    width: 150,
    formVisible: true,
    formEditable: true,
    filterable: false,
    sorter: false,
    enumData: wareHouseAreaTypeEnumSchema,
  },
];

export interface InputDto {}

export interface OutputDto {}
